import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 10 - 14
 * Time: 20:38
 */
//牛客 走方格的方案数
public class Solution5 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int m = in.nextInt();
            int n = in.nextInt();
            System.out.println(f(m, n));
        }
    }
    private static int f(int m, int n) {
        if((m == 1 && n >= 1) || (m >= 1 && n == 1)) {
            return m + n;
        }
        return f(m - 1, n) + f(m, n - 1);
    }
}
